package com.tsingteng.cosfun.ui.message.uploadreportfragment;

import android.util.Log;

import com.tsingteng.cosfun.bean.UploadReportBean;
import com.tsingteng.cosfun.bean.VideoSignBean;
import com.tsingteng.cosfun.callback.RxObserver;
import com.tsingteng.cosfun.mvp.presenter.BasePresenter;

import java.util.List;

/**
 * 上传举报原因页面P层
 * 常胜
 * 2018.8.21
 * */
public class UploadReportPresenter extends BasePresenter<UploadReportContract.IUploadReportView> implements UploadReportContract.IUploadReportPresenter {

    private final UploadReportModel uploadReportModel;
    private UploadReportContract.IUploadReportView view;
    public UploadReportPresenter(){
        uploadReportModel = new UploadReportModel();
    }
    @Override
    public void loginUploadReport(String report_id, long workId, int type, String msg, String image1,String image2,String image3,String image4) {
        view = getView();
        RxObserver<UploadReportBean> rxObserver = new RxObserver<UploadReportBean>(this) {
            @Override
            protected void onFaile(int errorCode, String errorMsg) {

            }

            @Override
            protected void onSuccess(UploadReportBean str) {
                view.showUploadReportResult(str);
            }
        };
        uploadReportModel.getUploadReport(report_id,workId,type,msg,image1,image2,image3,image4,rxObserver);
        addDisposable(rxObserver);
    }

    @Override
    public void loginUploadSeven() {
        view = getView();
        RxObserver<VideoSignBean> rxObserver = new RxObserver<VideoSignBean>(this) {
            @Override
            protected void onFaile(int errorCode, String errorMsg) {
                Log.e("娘们",errorMsg);
            }

            @Override
            protected void onSuccess(VideoSignBean s) {
                view.showUploadSeven(s);
            }
        };
        uploadReportModel.getUploadSeven(rxObserver);
        addDisposable(rxObserver);
    }
}
